#ifndef COMP_MESH_STATIC_H
#define COMP_MESH_STATIC_H

#include <AGTObjectSystem/ObjectSceneManager.h>
#include <AGTRenderSystem/RenderManager.h>

using namespace std;

class Comp_Mesh_Static : public Component
{
protected:
	string						m_sMeshName;
	Ogre::Entity*				m_pEntity;
	Ogre::SceneNode*			m_pSceneNode;
public:
	~Comp_Mesh_Static(void)
	{
	}

	void setup()
	{
		// The owner object is connected to the a scene manager. By getting the Ogre scene manager 
		// from the owner object we are getting the scene it is in. This is fundemental for the
		// setup method for mesh objects
		Ogre::SceneManager *ownerSceneMgr = ObjectSceneManager::getSingleton()->getSceneOfObject(m_ObjectOwner)->getOSceneMgr();

		// Then we can create the entity and nodes for this mesh component
		m_pEntity = ownerSceneMgr->createEntity(m_ObjectOwner->getName(),m_sMeshName);
		m_pSceneNode = ownerSceneMgr->getRootSceneNode()->createChildSceneNode(m_ObjectOwner->getName()+"_Node");
		m_pSceneNode->attachObject(m_pEntity);
	}

	void update()
	{
	}

	//------------ Own component codes here on for mesh family type ---------------- // 
	//                 Copy methods for every mesh family types						 //

	Comp_Mesh_Static(string mesh_name)
	{
		m_familyType = "Mesh";
		m_compType = "Static";
		m_sMeshName = mesh_name;
	}

	void setScale(double size_x, double size_y, double size_z)
	{
		m_pSceneNode->setScale(size_x,size_y,size_z);
	}

	void setScale(Ogre::Vector3 sizeVec)
	{
		m_pSceneNode->setScale(sizeVec);
	}

	Ogre::Entity* getEnity(void){ return m_pEntity; }
	Ogre::SceneNode* getSceneNode(void){ return m_pSceneNode; }
	string getMeshName(void){ return m_sMeshName; }


	//------------ Own component codes here on for compoent self type ---------------- //


};

#endif